﻿@model UserFormViewModelBase

<div class="editor-label">
	<label for="Email">@Strings.Email</label>	
</div>
<div class="editor-field">    
	@Html.TextBoxFor(m => m.Email, new { size = 40 })
	@Html.ValidationMessageFor(m => m.Email)    
</div>
<div class="editor-label">
	<label for="FirstName">@Strings.FirstName</label>
</div>	
<div class="editor-field">
	@Html.TextBoxFor(m => m.FirstName)
	@Html.ValidationMessageFor(m => m.FirstName)
</div>
<div class="editor-label">
    <label for="LastName">@Strings.LastName</label>	
</div>
<div class="editor-field">
	@Html.TextBoxFor(m => m.LastName)
	@Html.ValidationMessageFor(m => m.LastName)
</div>
@if (Model is MyAccountFormViewModel ) {     
    <div class="editor-label">					
	    <label for="Password">@Strings.Password</label>
    </div>
    <div class="editor-field">
	    @Html.PasswordFor(m => m.OldPassword)
	    @Html.ValidationMessageFor(m => m.OldPassword)
    </div> 
    <div class="editor-label">					
	    <label for="Password">@Strings.Account_NewPassword</label>
    </div>
    <div class="editor-field">
	    @Html.PasswordFor(m => m.NewPassword)
	    @Html.ValidationMessageFor(m => m.NewPassword)
    </div>
    <div class="editor-label">
	    <label for="ConfirmPassword">@Strings.Account_ConfirmPassword</label>
    </div>
    <div class="editor-field">
	    @Html.PasswordFor(m => m.ConfirmNewPassword)
	    @Html.ValidationMessageFor(m => m.ConfirmNewPassword)
    </div>
 } 
<div class="editor-label">
	<label for="Role">@Strings.Account_Role</label>
</div>
<div class="editor-field">				
@if( Model is CreateUserFormViewModel || Model is EditUserFormViewModel ) { 
	foreach( var role in Model.AvailableRoles ) { 			
        <div style="display:block;padding-left:120px;">
            <table >
                <tr>
                    <td><input type="radio" id="RoleFlag" name="RoleFlag" value='@role.RoleValue' @Model.RoleFlag == role.RoleValue ?  "checked='checked'" : "" /></td>
                    <td width="80px;">@role.Name</td>
                    <td><em>@role.Description</em></td>
                </tr>
            </table>
        </div>
	 } 				
 } else { 
    <p>@String.Join(",", ((User)Session["User"]).GetRoles())</p>
 } 
</div>
<div id="buttons">
	<input type="button" value="@Strings.Save" />
    @Html.CancelButton("Manage", "Account" )
</div>
